\(\int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx\) [779]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 24, antiderivative size = 107 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\frac {5}{8} a^2 x \sqrt {a^2-b^2 x^2}-\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {5 a^4 \arctan \left (\frac {b x}{\sqrt {a^2-b^2 x^2}}\right )}{8 b} \]

[Out]

-5/12*a*(-b^2*x^2+a^2)^(3/2)/b-1/4*(b*x+a)*(-b^2*x^2+a^2)^(3/2)/b+5/8*a^4*arctan(b*x/(-b^2*x^2+a^2)^(1/2))/b+5
/8*a^2*x*(-b^2*x^2+a^2)^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {685, 655, 201, 223, 209} \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\frac {5}{8} a^2 x \sqrt {a^2-b^2 x^2}-\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {5 a^4 \arctan \left (\frac {b x}{\sqrt {a^2-b^2 x^2}}\right )}{8 b} \]

[In]

Int[(a + b*x)^2*Sqrt[a^2 - b^2*x^2],x]

[Out]

(5*a^2*x*Sqrt[a^2 - b^2*x^2])/8 - (5*a*(a^2 - b^2*x^2)^(3/2))/(12*b) - ((a + b*x)*(a^2 - b^2*x^2)^(3/2))/(4*b)
 + (5*a^4*ArcTan[(b*x)/Sqrt[a^2 - b^2*x^2]])/(8*b)

Rule 201

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[x*((a + b*x^n)^p/(n*p + 1)), x] + Dist[a*n*(p/(n*p + 1)),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 655

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[e*((a + c*x^2)^(p + 1)/(2*c*(p + 1))),
x] + Dist[d, Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, p}, x] && NeQ[p, -1]

Rule 685

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*((a + c*x^2)^(p
 + 1)/(c*(m + 2*p + 1))), x] + Dist[2*c*d*((m + p)/(c*(m + 2*p + 1))), Int[(d + e*x)^(m - 1)*(a + c*x^2)^p, x]
, x] /; FreeQ[{a, c, d, e, p}, x] && EqQ[c*d^2 + a*e^2, 0] && GtQ[m, 1] && NeQ[m + 2*p + 1, 0] && IntegerQ[2*p
]

Rubi steps \begin{align*} \text {integral}& = -\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {1}{4} (5 a) \int (a+b x) \sqrt {a^2-b^2 x^2} \, dx \\ & = -\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {1}{4} \left (5 a^2\right ) \int \sqrt {a^2-b^2 x^2} \, dx \\ & = \frac {5}{8} a^2 x \sqrt {a^2-b^2 x^2}-\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {1}{8} \left (5 a^4\right ) \int \frac {1}{\sqrt {a^2-b^2 x^2}} \, dx \\ & = \frac {5}{8} a^2 x \sqrt {a^2-b^2 x^2}-\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {1}{8} \left (5 a^4\right ) \text {Subst}\left (\int \frac {1}{1+b^2 x^2} \, dx,x,\frac {x}{\sqrt {a^2-b^2 x^2}}\right ) \\ & = \frac {5}{8} a^2 x \sqrt {a^2-b^2 x^2}-\frac {5 a \left (a^2-b^2 x^2\right )^{3/2}}{12 b}-\frac {(a+b x) \left (a^2-b^2 x^2\right )^{3/2}}{4 b}+\frac {5 a^4 \tan ^{-1}\left (\frac {b x}{\sqrt {a^2-b^2 x^2}}\right )}{8 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.86 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\frac {\sqrt {a^2-b^2 x^2} \left (-16 a^3+9 a^2 b x+16 a b^2 x^2+6 b^3 x^3\right )-30 a^4 \arctan \left (\frac {b x}{\sqrt {a^2}-\sqrt {a^2-b^2 x^2}}\right )}{24 b} \]

[In]

Integrate[(a + b*x)^2*Sqrt[a^2 - b^2*x^2],x]

[Out]

(Sqrt[a^2 - b^2*x^2]*(-16*a^3 + 9*a^2*b*x + 16*a*b^2*x^2 + 6*b^3*x^3) - 30*a^4*ArcTan[(b*x)/(Sqrt[a^2] - Sqrt[
a^2 - b^2*x^2])])/(24*b)

Maple [A] (verified)

Time = 2.78 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.78

method result size
risch \(-\frac {\left (-6 b^{3} x^{3}-16 a \,b^{2} x^{2}-9 a^{2} b x +16 a^{3}\right ) \sqrt {-b^{2} x^{2}+a^{2}}}{24 b}+\frac {5 a^{4} \arctan \left (\frac {\sqrt {b^{2}}\, x}{\sqrt {-b^{2} x^{2}+a^{2}}}\right )}{8 \sqrt {b^{2}}}\) \(83\)
default \(a^{2} \left (\frac {x \sqrt {-b^{2} x^{2}+a^{2}}}{2}+\frac {a^{2} \arctan \left (\frac {\sqrt {b^{2}}\, x}{\sqrt {-b^{2} x^{2}+a^{2}}}\right )}{2 \sqrt {b^{2}}}\right )+b^{2} \left (-\frac {x \left (-b^{2} x^{2}+a^{2}\right )^{\frac {3}{2}}}{4 b^{2}}+\frac {a^{2} \left (\frac {x \sqrt {-b^{2} x^{2}+a^{2}}}{2}+\frac {a^{2} \arctan \left (\frac {\sqrt {b^{2}}\, x}{\sqrt {-b^{2} x^{2}+a^{2}}}\right )}{2 \sqrt {b^{2}}}\right )}{4 b^{2}}\right )-\frac {2 a \left (-b^{2} x^{2}+a^{2}\right )^{\frac {3}{2}}}{3 b}\) \(159\)

[In]

int((b*x+a)^2*(-b^2*x^2+a^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/24*(-6*b^3*x^3-16*a*b^2*x^2-9*a^2*b*x+16*a^3)/b*(-b^2*x^2+a^2)^(1/2)+5/8*a^4/(b^2)^(1/2)*arctan((b^2)^(1/2)
*x/(-b^2*x^2+a^2)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.79 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=-\frac {30 \, a^{4} \arctan \left (-\frac {a - \sqrt {-b^{2} x^{2} + a^{2}}}{b x}\right ) - {\left (6 \, b^{3} x^{3} + 16 \, a b^{2} x^{2} + 9 \, a^{2} b x - 16 \, a^{3}\right )} \sqrt {-b^{2} x^{2} + a^{2}}}{24 \, b} \]

[In]

integrate((b*x+a)^2*(-b^2*x^2+a^2)^(1/2),x, algorithm="fricas")

[Out]

-1/24*(30*a^4*arctan(-(a - sqrt(-b^2*x^2 + a^2))/(b*x)) - (6*b^3*x^3 + 16*a*b^2*x^2 + 9*a^2*b*x - 16*a^3)*sqrt
(-b^2*x^2 + a^2))/b

Sympy [A] (verification not implemented)

Time = 0.50 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.29 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\begin {cases} \frac {5 a^{4} \left (\begin {cases} \frac {\log {\left (- 2 b^{2} x + 2 \sqrt {- b^{2}} \sqrt {a^{2} - b^{2} x^{2}} \right )}}{\sqrt {- b^{2}}} & \text {for}\: a^{2} \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {- b^{2} x^{2}}} & \text {otherwise} \end {cases}\right )}{8} + \sqrt {a^{2} - b^{2} x^{2}} \left (- \frac {2 a^{3}}{3 b} + \frac {3 a^{2} x}{8} + \frac {2 a b x^{2}}{3} + \frac {b^{2} x^{3}}{4}\right ) & \text {for}\: b^{2} \neq 0 \\\sqrt {a^{2}} \left (\begin {cases} a^{2} x & \text {for}\: b = 0 \\\frac {\left (a + b x\right )^{3}}{3 b} & \text {otherwise} \end {cases}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((b*x+a)**2*(-b**2*x**2+a**2)**(1/2),x)

[Out]

Piecewise((5*a**4*Piecewise((log(-2*b**2*x + 2*sqrt(-b**2)*sqrt(a**2 - b**2*x**2))/sqrt(-b**2), Ne(a**2, 0)),
(x*log(x)/sqrt(-b**2*x**2), True))/8 + sqrt(a**2 - b**2*x**2)*(-2*a**3/(3*b) + 3*a**2*x/8 + 2*a*b*x**2/3 + b**
2*x**3/4), Ne(b**2, 0)), (sqrt(a**2)*Piecewise((a**2*x, Eq(b, 0)), ((a + b*x)**3/(3*b), True)), True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.68 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\frac {5 \, a^{4} \arcsin \left (\frac {b x}{a}\right )}{8 \, b} + \frac {5}{8} \, \sqrt {-b^{2} x^{2} + a^{2}} a^{2} x - \frac {1}{4} \, {\left (-b^{2} x^{2} + a^{2}\right )}^{\frac {3}{2}} x - \frac {2 \, {\left (-b^{2} x^{2} + a^{2}\right )}^{\frac {3}{2}} a}{3 \, b} \]

[In]

integrate((b*x+a)^2*(-b^2*x^2+a^2)^(1/2),x, algorithm="maxima")

[Out]

5/8*a^4*arcsin(b*x/a)/b + 5/8*sqrt(-b^2*x^2 + a^2)*a^2*x - 1/4*(-b^2*x^2 + a^2)^(3/2)*x - 2/3*(-b^2*x^2 + a^2)
^(3/2)*a/b

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.64 \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\frac {5 \, a^{4} \arcsin \left (\frac {b x}{a}\right ) \mathrm {sgn}\left (a\right ) \mathrm {sgn}\left (b\right )}{8 \, {\left | b \right |}} - \frac {1}{24} \, \sqrt {-b^{2} x^{2} + a^{2}} {\left (\frac {16 \, a^{3}}{b} - {\left (9 \, a^{2} + 2 \, {\left (3 \, b^{2} x + 8 \, a b\right )} x\right )} x\right )} \]

[In]

integrate((b*x+a)^2*(-b^2*x^2+a^2)^(1/2),x, algorithm="giac")

[Out]

5/8*a^4*arcsin(b*x/a)*sgn(a)*sgn(b)/abs(b) - 1/24*sqrt(-b^2*x^2 + a^2)*(16*a^3/b - (9*a^2 + 2*(3*b^2*x + 8*a*b
)*x)*x)

Mupad [F(-1)]

Timed out. \[ \int (a+b x)^2 \sqrt {a^2-b^2 x^2} \, dx=\int \sqrt {a^2-b^2\,x^2}\,{\left (a+b\,x\right )}^2 \,d x \]

[In]

int((a^2 - b^2*x^2)^(1/2)*(a + b*x)^2,x)

[Out]

int((a^2 - b^2*x^2)^(1/2)*(a + b*x)^2, x)